﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.Serialization;
using System.ServiceModel;
using System.Text;
using System.IO;
using System.ServiceModel.Web;
namespace SisocanaFronEnd.Services
{
    // NOTE: You can use the "Rename" command on the "Refactor" menu to change the interface name "IFileTransferService" in both code and config file together.
    [ServiceContract]
    public interface IFileTransferService
    {
        [OperationContract]
        ResponseMessage SaveFile(UploadStreamMessage uploadMessage);
    }

    [MessageContract]
    public class UploadStreamMessage
    {
        [MessageHeader]
        public string fileName;
        [MessageBodyMember]
        public Stream dataStream;
    }

    [MessageContract]
    public class ResponseMessage
    {
        [MessageHeader]
        public bool success;

        public ResponseMessage(bool success)
        {
            this.success = success;
        }

        public ResponseMessage() : this(false)
        {
        }
    }  
}
